(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.ratingType.viewController', viewController);
	viewController.$inject = [ '$scope', 'Constants', 'layoutConfig', 'validatorConfig', 'gridService', 'authService', 'ratingTypeService', 'modalService' ];
	function viewController($scope, Constants, layoutConfig, validatorConfig, gridService, authService, ratingTypeService, modalService) {
		var ctrl = this, params = $scope.$stateParams.params;
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;

		ctrl.init = function() {
			ratingTypeService.initData($scope, ctrl);
			authService.view(params).then(function(response) {
				ctrl.ratingType = response.data || params;
				ctrl.ratingType.ratingGrades = ctrl.ratingType.ratingGrades || [];
				ctrl.ratingType.ratingQaItems = ctrl.ratingType.ratingQaItems || [];
				ctrl.ratingType.ratingQaAdjs = ctrl.ratingType.ratingQaAdjs || [];
			});
		};

	}
})(angular);